home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 July
/
EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso
/
earcd
/
dev
/
amos
/
moreusel.lha
/
BetterRain.AMOS
/
BetterRain.amosSourceCode
Wrap
AMOS Source Code
|
1997-04-15
|
2KB
|
107 lines
' ************************************
' * *
' * Betterrain & Specialfade *
' * Written by C. Hodges *
' * *
' ************************************
'
' Three litte procedures:
'
' BETTERRAIN[rainbownumber,length]
' Function: Makes rainbows smoother.
'
' SPECIALFADE1[speed]
' Function: Like the fade command, but works by seperating the red, green
' and blue values.
'
' SPECIALFADE2[speed]
' Function: Fades each colour seperately with a small delay.
'
Dim SFC(31)
Screen Open 0,320,200,32,0
Curs Off : Flash Off : Paper 0 : Pen 31 : Cls
Set Rainbow 1,0,200,"","",""
R=0 : G=0 : B=15
For A=0 To 199
Rain(1,A)=R*$100+G*$10+B
If(A mod 4)=0 Then B=Max(B-1,0)
If(A mod 7)=0 and B=0 Then R=Min(R+1,15)
If(A mod 9)=6 and R=15 Then G=Min(G+1,15)
Next
Print "This is a normal Rainbow!"
Print "Press any key!"
Rainbow 1,0,49,200
Wait Key
BETTERRAIN[1,200]
Cls
Print "And this is BETTERRAIN!"
Print "Press any key!"
View
Wait Key
Cls
Rainbow Del : View
Load Iff "cam.iff",0
Screen Hide 0
Paper 12 : Pen 10 : Print "Using SPECIALFADE you can"
Print "produce great effects!"
For A=0 To 31 : SFC(A)=Colour(A) : Colour A,0 : Next
Screen Show 0
SPECIALFADE1[1]
Print "Press any key!"
Wait Key
For A=0 To 31 : SFC(A)=0 : Next
SPECIALFADE1[1]
Load Iff "wiesel.iff",0
Screen Hide 0
For A=0 To 31 : SFC(A)=Colour(A) : Colour A,0 : Next
Screen Show 0
SPECIALFADE2[1]
Wait Key
For A=0 To 31 : SFC(A)=0 : Next
SPECIALFADE2[1]
Procedure SPECIALFADE1[T]
Shared SFC()
M=$F0 : MU=$10 : Gosub FADRGB
M=$F00 : MU=$100 : Gosub FADRGB
M=$F : MU=1 : Gosub FADRGB
Pop Proc
FADRGB:
Do
B=0
For C=0 To 31
C1=Colour(C) : C2=SFC(C) and M
If(C1 and M)<>C2 Then Add C1,Sgn(C2-(C1 and M))*MU : Inc B
Colour C,C1
Next
Wait T
Exit If B=0
Loop
Return
End Proc
Procedure SPECIALFADE2[T]
Shared SFC()
S=Screen
Screen Open 7,16,16,2,0 : Screen Hide 7
For A=0 To 31 : Colour A,SFC(A) : Next
Screen S
B=1 : C=1
For A=0 To 31
Fade T To 7,C : Wait T*4
If A<30 Then B=B*2 : Add C,B Else C=-1 : B=0
Next
Wait T*12
Screen Close 7
End Proc
Procedure BETTERRAIN[R,L]
T=1 : AF=Rain(R,0)
For A=2 To L-1
Inc T
If(Rain(R,A)<>AF)
AF=Rain(R,A)
If T>3
Rain(R,A-2)=AF
End If
T=0
End If
Next
End Proc